<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>RandomKey (Apache Commons Math 3.6.1 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="RandomKey (Apache Commons Math 3.6.1 API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/RandomKey.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/math3/genetics/Population.html" title="interface in org.apache.commons.math3.genetics"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/commons/math3/genetics/RandomKeyMutation.html" title="class in org.apache.commons.math3.genetics"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/math3/genetics/RandomKey.html" target="_top">Frames</a></li>
<li><a href="RandomKey.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.commons.math3.genetics</div>
<h2 title="Class RandomKey" class="title">Class RandomKey&lt;T&gt;</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../../../org/apache/commons/math3/genetics/Chromosome.html" title="class in org.apache.commons.math3.genetics">org.apache.commons.math3.genetics.Chromosome</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../../../org/apache/commons/math3/genetics/AbstractListChromosome.html" title="class in org.apache.commons.math3.genetics">org.apache.commons.math3.genetics.AbstractListChromosome</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</a>&gt;</li>
<li>
<ul class="inheritance">
<li>org.apache.commons.math3.genetics.RandomKey&lt;T&gt;</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>T</code> - type of the permuted objects</dd></dl>
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a>&lt;<a href="../../../../../org/apache/commons/math3/genetics/Chromosome.html" title="class in org.apache.commons.math3.genetics">Chromosome</a>&gt;, <a href="../../../../../org/apache/commons/math3/genetics/Fitness.html" title="interface in org.apache.commons.math3.genetics">Fitness</a>, <a href="../../../../../org/apache/commons/math3/genetics/PermutationChromosome.html" title="interface in org.apache.commons.math3.genetics">PermutationChromosome</a>&lt;T&gt;</dd>
</dl>
<hr>
<br>
<pre>public abstract class <span class="strong">RandomKey&lt;T&gt;</span>
extends <a href="../../../../../org/apache/commons/math3/genetics/AbstractListChromosome.html" title="class in org.apache.commons.math3.genetics">AbstractListChromosome</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</a>&gt;
implements <a href="../../../../../org/apache/commons/math3/genetics/PermutationChromosome.html" title="interface in org.apache.commons.math3.genetics">PermutationChromosome</a>&lt;T&gt;</pre>
<div class="block">Random Key chromosome is used for permutation representation. It is a vector
 of a fixed length of real numbers in [0,1] interval. The index of the i-th
 smallest value in the vector represents an i-th member of the permutation.
 <p>
 For example, the random key [0.2, 0.3, 0.8, 0.1] corresponds to the
 permutation of indices (3,0,1,2). If the original (unpermuted) sequence would
 be (a,b,c,d), this would mean the sequence (d,a,b,c).
 <p>
 With this representation, common operators like n-point crossover can be
 used, because any such chromosome represents a valid permutation.
 <p>
 Since the chromosome (and thus its arrayRepresentation) is immutable, the
 array representation is sorted only once in the constructor.
 <p>
 For details, see:
 <ul>
   <li>Bean, J.C.: Genetic algorithms and random keys for sequencing and
       optimization. ORSA Journal on Computing 6 (1994) 154-160</li>
   <li>Rothlauf, F.: Representations for Genetic and Evolutionary Algorithms.
       Volume 104 of Studies in Fuzziness and Soft Computing. Physica-Verlag,
       Heidelberg (2002)</li>
 </ul></div>
<dl><dt><span class="strong">Since:</span></dt>
  <dd>2.0</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/commons/math3/genetics/RandomKey.html#RandomKey(java.lang.Double[])">RandomKey</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</a>[]&nbsp;representation)</code>
<div class="block">Constructor.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/commons/math3/genetics/RandomKey.html#RandomKey(java.util.List)">RandomKey</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</a>&gt;&nbsp;representation)</code>
<div class="block">Constructor.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/genetics/RandomKey.html#checkValidity(java.util.List)">checkValidity</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</a>&gt;&nbsp;chromosomeRepresentation)</code>
<div class="block">Asserts that <code>representation</code> can represent a valid chromosome.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static &lt;S&gt;&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/genetics/RandomKey.html#comparatorPermutation(java.util.List,%20java.util.Comparator)">comparatorPermutation</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;S&gt;&nbsp;data,
                     <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;S&gt;&nbsp;comparator)</code>
<div class="block">Generates a representation of a permutation corresponding to the
 <code>data</code> sorted by <code>comparator</code>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../../org/apache/commons/math3/genetics/RandomKey.html" title="type parameter in RandomKey">T</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/genetics/RandomKey.html#decode(java.util.List)">decode</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../../org/apache/commons/math3/genetics/RandomKey.html" title="type parameter in RandomKey">T</a>&gt;&nbsp;sequence)</code>
<div class="block">Permutes the <code>sequence</code> of objects of type T according to the
 permutation this chromosome represents.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/genetics/RandomKey.html#identityPermutation(int)">identityPermutation</a></strong>(int&nbsp;l)</code>
<div class="block">Generates a representation corresponding to an identity permutation of
 length l which can be passed to the RandomKey constructor.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;S&gt;&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/genetics/RandomKey.html#inducedPermutation(java.util.List,%20java.util.List)">inducedPermutation</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;S&gt;&nbsp;originalData,
                  <a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;S&gt;&nbsp;permutedData)</code>
<div class="block">Generates a representation of a permutation corresponding to a
 permutation which yields <code>permutedData</code> when applied to
 <code>originalData</code>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/genetics/RandomKey.html#isSame(org.apache.commons.math3.genetics.Chromosome)">isSame</a></strong>(<a href="../../../../../org/apache/commons/math3/genetics/Chromosome.html" title="class in org.apache.commons.math3.genetics">Chromosome</a>&nbsp;another)</code>
<div class="block">Returns <code>true</code> iff <code>another</code> is a RandomKey and
 encodes the same permutation.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/genetics/RandomKey.html#randomPermutation(int)">randomPermutation</a></strong>(int&nbsp;l)</code>
<div class="block">Generates a representation corresponding to a random permutation of
 length l which can be passed to the RandomKey constructor.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/genetics/RandomKey.html#toString()">toString</a></strong>()</code></td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.apache.commons.math3.genetics.AbstractListChromosome">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.commons.math3.genetics.<a href="../../../../../org/apache/commons/math3/genetics/AbstractListChromosome.html" title="class in org.apache.commons.math3.genetics">AbstractListChromosome</a></h3>
<code><a href="../../../../../org/apache/commons/math3/genetics/AbstractListChromosome.html#getLength()">getLength</a>, <a href="../../../../../org/apache/commons/math3/genetics/AbstractListChromosome.html#getRepresentation()">getRepresentation</a>, <a href="../../../../../org/apache/commons/math3/genetics/AbstractListChromosome.html#newFixedLengthChromosome(java.util.List)">newFixedLengthChromosome</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.apache.commons.math3.genetics.Chromosome">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.commons.math3.genetics.<a href="../../../../../org/apache/commons/math3/genetics/Chromosome.html" title="class in org.apache.commons.math3.genetics">Chromosome</a></h3>
<code><a href="../../../../../org/apache/commons/math3/genetics/Chromosome.html#compareTo(org.apache.commons.math3.genetics.Chromosome)">compareTo</a>, <a href="../../../../../org/apache/commons/math3/genetics/Chromosome.html#findSameChromosome(org.apache.commons.math3.genetics.Population)">findSameChromosome</a>, <a href="../../../../../org/apache/commons/math3/genetics/Chromosome.html#getFitness()">getFitness</a>, <a href="../../../../../org/apache/commons/math3/genetics/Chromosome.html#searchForFitnessUpdate(org.apache.commons.math3.genetics.Population)">searchForFitnessUpdate</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long,%20int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.apache.commons.math3.genetics.Fitness">
<!--   -->
</a>
<h3>Methods inherited from interface&nbsp;org.apache.commons.math3.genetics.<a href="../../../../../org/apache/commons/math3/genetics/Fitness.html" title="interface in org.apache.commons.math3.genetics">Fitness</a></h3>
<code><a href="../../../../../org/apache/commons/math3/genetics/Fitness.html#fitness()">fitness</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="RandomKey(java.util.List)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>RandomKey</h4>
<pre>public&nbsp;RandomKey(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</a>&gt;&nbsp;representation)
          throws <a href="../../../../../org/apache/commons/math3/genetics/InvalidRepresentationException.html" title="class in org.apache.commons.math3.genetics">InvalidRepresentationException</a></pre>
<div class="block">Constructor.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>representation</code> - list of [0,1] values representing the permutation</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/math3/genetics/InvalidRepresentationException.html" title="class in org.apache.commons.math3.genetics">InvalidRepresentationException</a></code> - iff the <code>representation</code> can not represent a valid chromosome</dd></dl>
</li>
</ul>
<a name="RandomKey(java.lang.Double[])">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>RandomKey</h4>
<pre>public&nbsp;RandomKey(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</a>[]&nbsp;representation)
          throws <a href="../../../../../org/apache/commons/math3/genetics/InvalidRepresentationException.html" title="class in org.apache.commons.math3.genetics">InvalidRepresentationException</a></pre>
<div class="block">Constructor.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>representation</code> - array of [0,1] values representing the permutation</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/math3/genetics/InvalidRepresentationException.html" title="class in org.apache.commons.math3.genetics">InvalidRepresentationException</a></code> - iff the <code>representation</code> can not represent a valid chromosome</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="decode(java.util.List)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decode</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../../org/apache/commons/math3/genetics/RandomKey.html" title="type parameter in RandomKey">T</a>&gt;&nbsp;decode(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../../../../org/apache/commons/math3/genetics/RandomKey.html" title="type parameter in RandomKey">T</a>&gt;&nbsp;sequence)</pre>
<div class="block">Permutes the <code>sequence</code> of objects of type T according to the
 permutation this chromosome represents. For example, if this chromosome
 represents a permutation (3,0,1,2), and the unpermuted sequence is
 (a,b,c,d), this yields (d,a,b,c).</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/math3/genetics/PermutationChromosome.html#decode(java.util.List)">decode</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/commons/math3/genetics/PermutationChromosome.html" title="interface in org.apache.commons.math3.genetics">PermutationChromosome</a>&lt;<a href="../../../../../org/apache/commons/math3/genetics/RandomKey.html" title="type parameter in RandomKey">T</a>&gt;</code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>sequence</code> - the unpermuted (original) sequence of objects</dd>
<dt><span class="strong">Returns:</span></dt><dd>permutation of <code>sequence</code> represented by this permutation</dd></dl>
</li>
</ul>
<a name="isSame(org.apache.commons.math3.genetics.Chromosome)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSame</h4>
<pre>protected&nbsp;boolean&nbsp;isSame(<a href="../../../../../org/apache/commons/math3/genetics/Chromosome.html" title="class in org.apache.commons.math3.genetics">Chromosome</a>&nbsp;another)</pre>
<div class="block">Returns <code>true</code> iff <code>another</code> is a RandomKey and
 encodes the same permutation.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/math3/genetics/Chromosome.html#isSame(org.apache.commons.math3.genetics.Chromosome)">isSame</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/commons/math3/genetics/Chromosome.html" title="class in org.apache.commons.math3.genetics">Chromosome</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>another</code> - chromosome to compare</dd>
<dt><span class="strong">Returns:</span></dt><dd>true iff chromosomes encode the same permutation</dd></dl>
</li>
</ul>
<a name="checkValidity(java.util.List)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>checkValidity</h4>
<pre>protected&nbsp;void&nbsp;checkValidity(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</a>&gt;&nbsp;chromosomeRepresentation)
                      throws <a href="../../../../../org/apache/commons/math3/genetics/InvalidRepresentationException.html" title="class in org.apache.commons.math3.genetics">InvalidRepresentationException</a></pre>
<div class="block">Asserts that <code>representation</code> can represent a valid chromosome.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/math3/genetics/AbstractListChromosome.html#checkValidity(java.util.List)">checkValidity</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/commons/math3/genetics/AbstractListChromosome.html" title="class in org.apache.commons.math3.genetics">AbstractListChromosome</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</a>&gt;</code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>chromosomeRepresentation</code> - representation of the chromosome</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/math3/genetics/InvalidRepresentationException.html" title="class in org.apache.commons.math3.genetics">InvalidRepresentationException</a></code> - iff the <code>representation</code> can not represent a valid chromosome</dd></dl>
</li>
</ul>
<a name="randomPermutation(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>randomPermutation</h4>
<pre>public static final&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</a>&gt;&nbsp;randomPermutation(int&nbsp;l)</pre>
<div class="block">Generates a representation corresponding to a random permutation of
 length l which can be passed to the RandomKey constructor.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>l</code> - length of the permutation</dd>
<dt><span class="strong">Returns:</span></dt><dd>representation of a random permutation</dd></dl>
</li>
</ul>
<a name="identityPermutation(int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>identityPermutation</h4>
<pre>public static final&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</a>&gt;&nbsp;identityPermutation(int&nbsp;l)</pre>
<div class="block">Generates a representation corresponding to an identity permutation of
 length l which can be passed to the RandomKey constructor.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>l</code> - length of the permutation</dd>
<dt><span class="strong">Returns:</span></dt><dd>representation of an identity permutation</dd></dl>
</li>
</ul>
<a name="comparatorPermutation(java.util.List, java.util.Comparator)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>comparatorPermutation</h4>
<pre>public static&nbsp;&lt;S&gt;&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</a>&gt;&nbsp;comparatorPermutation(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;S&gt;&nbsp;data,
                                     <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html?is-external=true" title="class or interface in java.util">Comparator</a>&lt;S&gt;&nbsp;comparator)</pre>
<div class="block">Generates a representation of a permutation corresponding to the
 <code>data</code> sorted by <code>comparator</code>. The
 <code>data</code> is not modified during the process.

 This is useful if you want to inject some permutations to the initial
 population.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>S</code> - type of the data</dd><dt><span class="strong">Parameters:</span></dt><dd><code>data</code> - list of data determining the order</dd><dd><code>comparator</code> - how the data will be compared</dd>
<dt><span class="strong">Returns:</span></dt><dd>list representation of the permutation corresponding to the parameters</dd></dl>
</li>
</ul>
<a name="inducedPermutation(java.util.List, java.util.List)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>inducedPermutation</h4>
<pre>public static&nbsp;&lt;S&gt;&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</a>&gt;&nbsp;inducedPermutation(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;S&gt;&nbsp;originalData,
                                  <a href="http://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;S&gt;&nbsp;permutedData)
                                       throws <a href="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</a>,
                                              <a href="../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></pre>
<div class="block">Generates a representation of a permutation corresponding to a
 permutation which yields <code>permutedData</code> when applied to
 <code>originalData</code>.

 This method can be viewed as an inverse to <a href="../../../../../org/apache/commons/math3/genetics/RandomKey.html#decode(java.util.List)"><code>decode(List)</code></a>.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>S</code> - type of the data</dd><dt><span class="strong">Parameters:</span></dt><dd><code>originalData</code> - the original, unpermuted data</dd><dd><code>permutedData</code> - the data, somehow permuted</dd>
<dt><span class="strong">Returns:</span></dt><dd>representation of a permutation corresponding to the permutation
   <code>originalData -> permutedData</code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</a></code> - iff the length of <code>originalData</code>
   and <code>permutedData</code> lists are not equal</dd>
<dd><code><a href="../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></code> - iff the <code>permutedData</code> and
   <code>originalData</code> lists contain different data</dd></dl>
</li>
</ul>
<a name="toString()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;toString()</pre>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="../../../../../org/apache/commons/math3/genetics/AbstractListChromosome.html#toString()">toString</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/commons/math3/genetics/AbstractListChromosome.html" title="class in org.apache.commons.math3.genetics">AbstractListChromosome</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</a>&gt;</code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/RandomKey.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/commons/math3/genetics/Population.html" title="interface in org.apache.commons.math3.genetics"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/commons/math3/genetics/RandomKeyMutation.html" title="class in org.apache.commons.math3.genetics"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/commons/math3/genetics/RandomKey.html" target="_top">Frames</a></li>
<li><a href="RandomKey.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2003&#x2013;2016 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>
